<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>字符串单词倒置</title>
    <script>
      //倒置字符串单词
      function invertStrWord(str) {
        //分隔，翻转，拼接
        return str.split(" ").reverse().join(" ");
      }
      console.log(invertStrWord("i come from beijing"));
    </script>
  </head>
  <body></body>
</html>
